import { get, post, put, deleteApi } from '@/utils/api'

export function login(data) {
    return post('/admin/users/login', data)
}

export function getInfo(token) {
    return get('/admin/users/info', { token })
}

export function pageQuery(queryParams) {
    return get('/admin/users/page', queryParams)
}

export function userRolePageQuery(queryParams) {
    return get('/admin/users/role/page', queryParams)
}

export function insert(data) {
    return post('/admin/users', data)
}

export function update(data) {
    return put('/admin/users', data)
}

export function deleteData(ids) {
    return deleteApi('/admin/users', ids)
}

export function grantRole(data) {
    return post('/admin/users/role', data)
}

export function deleteUserRole(ids) {
    return deleteApi('/admin/users/role', ids)
}
